import {Injectable} from '@angular/core';
import {HttpClient} from '@angular/common/http';

@Injectable({
  providedIn: 'root'
})
export class ModelBasePriceService {

  constructor(
    private httpClient: HttpClient
  ) {
  }

  getModelBasePriceList(body: any) {
    return this.httpClient.post('/recycleBenchmarkPrice/list', body).toPromise();
  }

  /**
   *  id id
   *  brandId    品牌id
   *  category    所属品类 1.手机 2.平板
   *  seriesId    系列id
   *  modelId    所属机型id
   *  note    备注
   *  content    内容
   *  deleteState    删除状态(0表示未删除 1表示已删除)
   */
  modifyModelBasePriceList(body: any) {
    const url = body.id ? '/recycleBenchmarkPrice/update' : '/recycleBenchmarkPrice/save';
    return this.httpClient.post(url, body).toPromise();
  }
}
